package day3zy;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Map {
    public static void main(String[] args) {
        HashMap<String, String> z = new HashMap<>();
        z.put("来", "come");
        z.put("去", "go");
        z.put("点头", "yes");
        z.put("狗", "dog");
        z.put("牛", "cow");
        z.put("猫", "cat");
        System.out.println("请输入要翻译的中文：");
        Scanner in = new Scanner(System.in);
        String zw = in.next();
        for (int i = 0; i < z.size(); i++) {
            String yw = z.get(zw);
            if (z.containsKey(zw))
                System.out.println(zw + "对应的英文：" + yw);
            else
                System.out.println("不存在");
            break;
        }
        System.out.println("请输入要翻译的英文：");
        String yw = in.next();
    }
}









